<!--
 * @LastEditors: yuSeen
 * @LastEditTime: 2021-11-24 14:48:12
 * 天凉好个秋
-->
<template>
  <div class="item">
    <div class="tit">{{ title }}：</div>
    <div class="input">
      <div class="input-line">
        <span class="sp1">
          <input
            class="radio"
            :name="title"
            :checked="!attr[ckey]"
            @click="attr[ckey] = false"
            type="radio"
          />
          {{ offName }}
        </span>
        <span class="sp1">
          <input
            class="radio"
            :name="title"
            :checked="attr[ckey]"
            @click="attr[ckey] = true"
            type="radio"
          />
          {{ onName }}
        </span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    name: 'setSwitchAttr',
    props: {
      attr: {
        type: Object
      },
      ckey: {
        type: String
      },
      title: {
        type: String
      },
      onName: { //状态为打开时的文本
        type: String,
        default: '显示'
      },
      offName: { //状态为关闭时的文本
        type: String,
        default: '隐藏'
      }
    }
}
</script>